home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / msm-2 / iconc.sit / trans.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-19  |  1.4 KB  |  53 lines  |  [TEXT/MPS ]

  1. #ifdef strlen
  2. #undef strlen            /* defined in some contexts */
  3. #endif /* strlen */
  4.  
  5. #define Abs(n) ((n) >= 0 ? (n) : -(n))
  6. #define Max(x,y) ((x)>(y)?(x):(y))
  7.  
  8. #if !EBCDIC
  9. #define tonum(c)    (isdigit(c) ? (c - '0') : ((c & 037) + 9))
  10. #endif                    /* !EBCDIC */
  11.  
  12. /*
  13.  * Hash tables must be a power of 2.
  14.  */
  15. #define CHSize 128    /* size of constant hash table */
  16. #define FHSize  32    /* size of field hash table */
  17. #define GHSize 128    /* size of global hash table */
  18. #define LHSize 128    /* size of local hash table */
  19.  
  20. #define PrfxSz 3        /* size of prefix */
  21.  
  22. /*
  23.  * srcfile is used construct the queue of source files to be translated.
  24.  */
  25. struct srcfile {
  26.    char *name;
  27.    struct srcfile *next;
  28.    };
  29.  
  30. extern struct srcfile *srclst;
  31.  
  32. /*
  33.  * External definitions needed throughout translator.
  34.  */
  35.  
  36. extern int yychar;        /* parser's current input token type */
  37. extern int yynerrs;        /* number of errors in parse */
  38.  
  39. extern int in_line;        /* current line number in input */
  40. extern int incol;        /* current column number in input */
  41. extern int peekc;        /* one character look-ahead */
  42. extern FILE *srcfile;        /* current input file */
  43. extern FILE *codefile;        /* C code output - primary file */
  44. extern FILE *inclfile;        /* C code output - include file */
  45. extern int twarns, tfatals;
  46.  
  47. #ifdef TranStats
  48. #include "tstats.h"
  49. #else                    /* TranStats */
  50. #define TokInc(x)
  51. #define TokDec(x)
  52. #endif                    /* TranStats */
  53.